package Lesson17Class.cars;

public class Car {

	protected String model;
	private int maxSpeed;
	protected int currentSpeed;
	protected int currentGear;
	protected int numberOfDoors;
	private int idNumber;
	protected boolean isSportsCar;
	protected Person owner;
	
	protected String type = "Just a car";
	
	Car(int maxSpeed)
	{
		this.maxSpeed = maxSpeed;
	}

	protected short getMaxSpeed() 
	{
		return (short)maxSpeed;
	}
	
	protected void changeOwner(Person newOwner)
	{
		this.owner = newOwner;
	}
	
	protected void startEngine()
	{
		System.out.println("Engine started! Brum!");
	}
	
	private void changeGear(int newGear)
	{
		this.currentGear = newGear;
	}
	
	protected void accelerate(double speed)
	{
		if(currentSpeed + speed > maxSpeed)
			currentSpeed = maxSpeed;
		else
			currentSpeed += speed;
		System.out.println("Now driving at " + currentSpeed + " km/h");
	}
	
	
}
